package day18_Reflection.demo06_Reg;

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

//验证QQ和163
//5—10个数字@qq.com   5—10个字母和数字zuc(要么全为数字，要么第一个为字母后面由数字和字母组合的)@163.com
public class Demo07_验证QQ和163邮箱 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        String reg="^(\\d{5,10}@qq.com)|(\\d{5,10}|[A-Za-z][A-Za-z0-9]{4,9}@163.com)$";
        Pattern compile = Pattern.compile(reg);
        Matcher matcher = compile.matcher(s);
        boolean matches = matcher.matches();
        System.out.println(matches);
    }
}
